package com.woniu.new_orange.personnel_model_wu.controller;

import com.woniu.new_orange.entity.Evaluate;
import com.woniu.new_orange.personnel_model_wu.VO.EvaluationVo;
import com.woniu.new_orange.personnel_model_wu.service.EvaluationService;
import com.woniu.new_orange.util.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.ognl.Evaluation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Program: new_orange->EvalutaionController
 * @Description:
 * @Author: 13488
 * @Date: 2023-02-07 20:16
 * @Version： 1.0
 **/
@RestController
@RequestMapping("evaluation")
@Api(tags = "评价")
public class EvalutaionController {
    @Resource
    private EvaluationService evaluationService;

    @GetMapping("{id}")
    @ApiOperation(value = "/根据用户id查询评价内容")
    public Result getAll(@PathVariable long id){
       List<EvaluationVo> evaluationVos = evaluationService.selectAll(id);
      return   Result.ok().data("evaluationForm",evaluationVos) ;
    }
    @PostMapping("add")
    public Result add(@RequestBody Evaluate evaluation){
       int i = evaluationService.insertSelective(evaluation);
        return   Result.ok();
    }
}
